﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Model.Admin.ApartmentCrudViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Stanovi
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Uredi stan</h2>

    <% Html.EnableClientValidation(); %>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        
        <fieldset>
            <legend>Forma za unos podataka</legend>
            
            <div class="editor-label">
                <%: Html.Label("Kod") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Code) %>
                <%: Html.ValidationMessageFor(model => model.Code) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Zgrada") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Building) %>
                <%: Html.ValidationMessageFor(model => model.Building) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Stanje") %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(m => m.SelectedState, new SelectList(Model.States, "Id", "Name" , Model.SelectedState)) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Kat") %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(m => m.SelectedFloor, new SelectList(Model.Floors, "Id", "Name" , Model.SelectedFloor)) %>
            </div>
            
            <div class="editor-label">
                <%: Html.Label("Broj soba") %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(m => m.SelectedRoomsNumber, new SelectList(Model.RoomsNumbers, "Id", "Name" , Model.SelectedRoomsNumber)) %>
            </div>

            <div class="editor-label">
                 <%: Html.Label("Pročelje") %>
            </div>
            <div class="editor-field">
                <%: Html.DropDownListFor(m => m.SelectedFacade, new SelectList(Model.Facades, "Id", "Name" , Model.SelectedFacade)) %>
            </div>
            
            <div class="editor-label">
                <%: Html.Label("Model") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.ApartmentModel) %>
                <%: Html.ValidationMessageFor(model => model.ApartmentModel) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Cijena") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Price) %>
                <%: Html.ValidationMessageFor(model => model.Price) %>
            </div>
            
            <div class="editor-label">
                 <%: Html.Label("Površina") %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Area) %>
                <%: Html.ValidationMessageFor(model => model.Area) %>
            </div>
            
            <p>
                <input type="submit" value="Spremi promjene" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Povratak na pregled stanova", "Index") %>
    </div>

</asp:Content>

